#ifndef QABSTRACTGRAPHICS_H
#define QABSTRACTGRAPHICS_H

#include "../../libs/shared/qcommonstruct.h"
#include "../../libs/shared/host/qwidgethost.h"

#include <QWidget>

class QAbstractGraphicsWidget : public QWidget
{
    Q_OBJECT
    Q_PROPERTY(tagPenInfo pen READ pen WRITE setPen)
    Q_PROPERTY(bool antialiasing READ antialiasing WRITE setAntialiasing)
public:
    explicit QAbstractGraphicsWidget(QWidget *parent = 0);

    void    setPen(tagPenInfo pen);
    tagPenInfo     pen();

    void    setAntialiasing(bool antialiasing);
    bool    antialiasing();
protected:
    QPen        m_pen;
    tagPenInfo  m_pen_info;
    bool        m_antialiasing;
};

class QAbstractGraphicsHost: public QWidgetHost
{
    Q_OBJECT
protected:
    QAbstractGraphicsHost(QAbstractHost* parent=0);
    void init_property();
protected:
public:
    void    setPenWidth(int penWidth);
    int     penWidth();

    void    setPenStyle(int penStyle);
    int     penStyle();

    void    setCapStyle(int capStyle);
    int     capStyle();

    void    setJoinStyle(int joinStyle);
    int     joinStyle();

    void    setAntialiasing(bool antialiasing);
    bool    antialiasing();
};

#endif // QABSTRACTGRAPHICS_H
